package com.leandom.studydemo;

import android.os.Bundle;

import com.leandom.studydemo.activity.AsyncActivity;
import com.leandom.studydemo.activity.ContentResolverActivity;
import com.leandom.studydemo.activity.PersistenceActivity;
import com.leandom.studydemo.adapter.ExampleAdapter;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class MainActivity extends AppCompatActivity {

    private RecyclerView mRecyclerView;
    private static ExampleAdapter.Item[] mDemos = new ExampleAdapter.Item[]{
            new ExampleAdapter.Item("ContentResolver & ContentProvider", ContentResolverActivity.class),
            new ExampleAdapter.Item("Persistence", PersistenceActivity.class),
            new ExampleAdapter.Item("Async", AsyncActivity.class),
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mRecyclerView = findViewById(R.id.recyclerView);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mRecyclerView.setAdapter(new ExampleAdapter(mDemos));
    }

}
